package me.ereach.di;

public class Point {
    private float x;
    private float y;
    IGeometry iGeometry;

    public Point(float x, float y) {
        this.x = x;
        this.y = y;
    }

    public Point(float x, float y, IGeometry iGeometry) {
        this.x = x;
        this.y = y;
        this.iGeometry = iGeometry;
    }

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public IGeometry getiGeometry() {
        return iGeometry;
    }

    public void setiGeometry(IGeometry iGeometry) {
        this.iGeometry = iGeometry;
    }

    @Override
    public String toString() {
        return "Point{" +
                "x=" + x +
                ", y=" + y +
                '}';
    }

    private double getDistance(Point p1, Point p2) {
        return iGeometry.getDistance(p1, p2);
    }

    public double getDistance(Point other) {
        return this.getDistance(this, other);
    }
}
